<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

$browser = new sfTestFunctional(new sfBrowser());

//$browser->
//  get('/job/index')->
//
//  with('request')->begin()->
//    isParameter('module', 'job')->
//    isParameter('action', 'index')->
//  end()->
//
//  with('response')->begin()->
//    isStatusCode(200)->
//    checkElement('body', '!/This is a temporary page/')->
//  end()
//;

$browser->
        info('4 - User job history')->
        loadData()->
        restart()->
        info('  4.1 - When the user access a job, it is added to its history')->
        get('/')->
        click('Web Developer', array(), array('position' => 1))->
        get('/')->
        with('user')->begin()->
        isAttribute('job_history', array($browser->getMostRecentProgrammingJob()->getId()))->
        end()->
        info('  4.2 - A job is not added twice in the history')->
        click('Web Developer', array(), array('position' => 1))->
        get('/')->
        with('user')->begin()->
        isAttribute('job_history', array($browser->getMostRecentProgrammingJob()->getId()))->
        end()
;
